import request from '@/api/request.js'
// 用户列表
export const getUserList = (params) => {
  return request({
    url: '/admin_global/v_list',
    method: 'GET',
    params
  })
}
// 点击修改按钮查询信息

export const getupdate = (params) => {
  return request({
    url: `admin_global/v_edit?id=${params.id}`,
    method: 'GET',
    params
  })
}

// 添加用户
export const insertUser = (data) => {
  return request({
    url: 'admin_global/o_save',
    method: 'post',
    data
  })
}
// 修改用户
export const updatetUser = (data) => {
  return request({
    url: 'admin_global/o_update',
    method: 'post',
    data
  })
}

// 删除用户
export const deleteUser = (params) => {
  return request({
    url: `admin_global/o_delete?ids=${params.ids}`,
    method: 'post'
  })
}

// 点击添加按钮返回角色和机构
export const getRoles = () => {
  return request({
    url: 'admin_global/v_add',
    method: 'GET'
  })
}
